package com.bootdo.lgs.combox.controller;

import com.bootdo.lgs.ordertrace.model.OrderTrace;
import javafx.scene.input.DataFormat;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;

public class Demo1 {

    public static void main(String[] args) {
        List<OrderTrace> list = new ArrayList<>();
        OrderTrace a = new OrderTrace();
        a.setFtime("1994-11-24 07:11:24");
        a.setContext("aaa");
        OrderTrace b = new OrderTrace();
        b.setFtime("2004-11-24 07:11:24");
        b.setContext("bbb");
        list.add(a);
        list.add(b);
        List<OrderTrace> newList = new ArrayList<>();
        if (list != null && list.size() > 0)
            newList = list.stream().sorted(Comparator.comparing(OrderTrace::getFtime).reversed()).collect(Collectors.toList());
        System.out.println(newList);


//        Kn api = new Kn();
//        try {
//            //String result = api.getOrderTracesByJson("ANE", "210001633605");
//            String result = api.getOrderTracesByJson("ANEKY", "300278862051");
//            System.out.print(result);
//
//        } catch (Exception e) {
//            e.printStackTrace();
//        }
    }

}
